
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>工程配置 · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="tsconfig.json.html" />
    
    
    <link rel="prev" href="declaration files/Consumption.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="tutorials/">
            
                <a href="tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="tutorials/TypeScript in 5 minutes.html">
            
                <a href="tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="tutorials/ASP.NET Core.html">
            
                <a href="tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="tutorials/ASP.NET 4.html">
            
                <a href="tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="tutorials/Gulp.html">
            
                <a href="tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="tutorials/Knockout.html">
            
                <a href="tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="tutorials/React & Webpack.html">
            
                <a href="tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="tutorials/React.html">
            
                <a href="tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="tutorials/Angular 2.html">
            
                <a href="tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="tutorials/Migrating from JavaScript.html">
            
                <a href="tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="Basic Types.html">
            
                <a href="Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="Variable Declarations.html">
            
                <a href="Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="Interfaces.html">
            
                <a href="Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="Classes.html">
            
                <a href="Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="Functions.html">
            
                <a href="Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="Generics.html">
            
                <a href="Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="Enums.html">
            
                <a href="Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="Type Inference.html">
            
                <a href="Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="Type Compatibility.html">
            
                <a href="Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="Advanced Types.html">
            
                <a href="Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="Symbols.html">
            
                <a href="Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="Iterators and Generators.html">
            
                <a href="Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="Modules.html">
            
                <a href="Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="Namespaces.html">
            
                <a href="Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="Namespaces and Modules.html">
            
                <a href="Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="Module Resolution.html">
            
                <a href="Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="Declaration Merging.html">
            
                <a href="Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="Writing Definition Files.html">
            
                <a href="Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="JSX.html">
            
                <a href="JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="Decorators.html">
            
                <a href="Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="Mixins.html">
            
                <a href="Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="Triple-Slash Directives.html">
            
                <a href="Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="Type Checking JavaScript Files.html">
            
                <a href="Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="declaration files/Introduction.html">
            
                <a href="declaration files/Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="declaration files/Library Structures.html">
            
                <a href="declaration files/Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="declaration files/Do's and Don'ts.html">
            
                <a href="declaration files/Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="declaration files/By Example.html">
            
                <a href="declaration files/By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="declaration files/Deep Dive.html">
            
                <a href="declaration files/Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="declaration files/Publishing.html">
            
                <a href="declaration files/Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="declaration files/Consumption.html">
            
                <a href="declaration files/Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.5" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.5.1" data-path="tsconfig.json.html">
            
                <a href="tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="Project References.html">
            
                <a href="Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="Typings for NPM Packages.html">
            
                <a href="Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="Compiler Options.html">
            
                <a href="Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="Configuring Watch.html">
            
                <a href="Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="Compiler Options in MSBuild.html">
            
                <a href="Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="Integrating with Build Tools.html">
            
                <a href="Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="Nightly Builds.html">
            
                <a href="Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../wiki/">
            
                <a href="../wiki/">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../wiki/this-in-TypeScript.html">
            
                <a href="../wiki/this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../wiki/coding_guidelines.html">
            
                <a href="../wiki/coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../wiki/Common Errors.html">
            
                <a href="../wiki/Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../wiki/TypeScript-Editor-Support.html">
            
                <a href="../wiki/TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="../wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../wiki/Architectural-Overview.html">
            
                <a href="../wiki/Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../wiki/Roadmap.html">
            
                <a href="../wiki/Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../release-notes/">
            
                <a href="../release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../release-notes/TypeScript 3.1.html">
            
                <a href="../release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../release-notes/TypeScript 3.0.html">
            
                <a href="../release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../release-notes/TypeScript 2.9.html">
            
                <a href="../release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../release-notes/TypeScript 2.8.html">
            
                <a href="../release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../release-notes/TypeScript 2.7.html">
            
                <a href="../release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../release-notes/TypeScript 2.6.html">
            
                <a href="../release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../release-notes/TypeScript 2.5.html">
            
                <a href="../release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="../release-notes/TypeScript 2.4.html">
            
                <a href="../release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="../release-notes/TypeScript 2.3.html">
            
                <a href="../release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="../release-notes/TypeScript 2.2.html">
            
                <a href="../release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="../release-notes/TypeScript 2.1.html">
            
                <a href="../release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="../release-notes/TypeScript 2.0.html">
            
                <a href="../release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="../release-notes/TypeScript 1.8.html">
            
                <a href="../release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="../release-notes/TypeScript 1.7.html">
            
                <a href="../release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="../release-notes/TypeScript 1.6.html">
            
                <a href="../release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="../release-notes/TypeScript 1.5.html">
            
                <a href="../release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="../release-notes/TypeScript 1.4.html">
            
                <a href="../release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="../release-notes/TypeScript 1.3.html">
            
                <a href="../release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="../release-notes/TypeScript 1.1.html">
            
                <a href="../release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../breaking-changes/breaking-changes.html">
            
                <a href="../breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../breaking-changes/TypeScript 2.4.html">
            
                <a href="../breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../breaking-changes/TypeScript 2.3.html">
            
                <a href="../breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../breaking-changes/TypeScript 2.2.html">
            
                <a href="../breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../breaking-changes/TypeScript 2.1.html">
            
                <a href="../breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../breaking-changes/TypeScript 2.0.html">
            
                <a href="../breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../breaking-changes/TypeScript 1.8.html">
            
                <a href="../breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../breaking-changes/TypeScript 1.7.html">
            
                <a href="../breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../breaking-changes/TypeScript 1.6.html">
            
                <a href="../breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../breaking-changes/TypeScript 1.5.html">
            
                <a href="../breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../breaking-changes/TypeScript 1.4.html">
            
                <a href="../breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >工程配置</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x6982;&#x8FF0;">&#x6982;&#x8FF0;</h2>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#x4E0B;&#x5B58;&#x5728;&#x4E00;&#x4E2A;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x610F;&#x5473;&#x7740;&#x8FD9;&#x4E2A;&#x76EE;&#x5F55;&#x662F;TypeScript&#x9879;&#x76EE;&#x7684;&#x6839;&#x76EE;&#x5F55;&#x3002;
<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x4E2D;&#x6307;&#x5B9A;&#x4E86;&#x7528;&#x6765;&#x7F16;&#x8BD1;&#x8FD9;&#x4E2A;&#x9879;&#x76EE;&#x7684;&#x6839;&#x6587;&#x4EF6;&#x548C;&#x7F16;&#x8BD1;&#x9009;&#x9879;&#x3002;
&#x4E00;&#x4E2A;&#x9879;&#x76EE;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x65B9;&#x5F0F;&#x4E4B;&#x4E00;&#x6765;&#x7F16;&#x8BD1;&#xFF1A;</p>
<h2 id="&#x4F7F;&#x7528;tsconfigjson">&#x4F7F;&#x7528;tsconfig.json</h2>
<ul>
<li>&#x4E0D;&#x5E26;&#x4EFB;&#x4F55;&#x8F93;&#x5165;&#x6587;&#x4EF6;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x8C03;&#x7528;<code>tsc</code>&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x4F1A;&#x4ECE;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x5F00;&#x59CB;&#x53BB;&#x67E5;&#x627E;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#xFF0C;&#x9010;&#x7EA7;&#x5411;&#x4E0A;&#x641C;&#x7D22;&#x7236;&#x76EE;&#x5F55;&#x3002;</li>
<li>&#x4E0D;&#x5E26;&#x4EFB;&#x4F55;&#x8F93;&#x5165;&#x6587;&#x4EF6;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x8C03;&#x7528;<code>tsc</code>&#xFF0C;&#x4E14;&#x4F7F;&#x7528;&#x547D;&#x4EE4;&#x884C;&#x53C2;&#x6570;<code>--project</code>&#xFF08;&#x6216;<code>-p</code>&#xFF09;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x5305;&#x542B;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x7684;&#x76EE;&#x5F55;&#x3002;</li>
</ul>
<p>&#x5F53;&#x547D;&#x4EE4;&#x884C;&#x4E0A;&#x6307;&#x5B9A;&#x4E86;&#x8F93;&#x5165;&#x6587;&#x4EF6;&#x65F6;&#xFF0C;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x4F1A;&#x88AB;&#x5FFD;&#x7565;&#x3002;</p>
<h2 id="&#x793A;&#x4F8B;">&#x793A;&#x4F8B;</h2>
<p><code>tsconfig.json</code>&#x793A;&#x4F8B;&#x6587;&#x4EF6;:</p>
<ul>
<li>&#x4F7F;&#x7528;<code>&quot;files&quot;</code>&#x5C5E;&#x6027;</li>
</ul>
<pre><code class="lang-json">{
    <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
        <span class="hljs-string">&quot;module&quot;</span>: <span class="hljs-string">&quot;commonjs&quot;</span>,
        <span class="hljs-string">&quot;noImplicitAny&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;removeComments&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;preserveConstEnums&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;sourceMap&quot;</span>: <span class="hljs-literal">true</span>
    },
    <span class="hljs-string">&quot;files&quot;</span>: [
        <span class="hljs-string">&quot;core.ts&quot;</span>,
        <span class="hljs-string">&quot;sys.ts&quot;</span>,
        <span class="hljs-string">&quot;types.ts&quot;</span>,
        <span class="hljs-string">&quot;scanner.ts&quot;</span>,
        <span class="hljs-string">&quot;parser.ts&quot;</span>,
        <span class="hljs-string">&quot;utilities.ts&quot;</span>,
        <span class="hljs-string">&quot;binder.ts&quot;</span>,
        <span class="hljs-string">&quot;checker.ts&quot;</span>,
        <span class="hljs-string">&quot;emitter.ts&quot;</span>,
        <span class="hljs-string">&quot;program.ts&quot;</span>,
        <span class="hljs-string">&quot;commandLineParser.ts&quot;</span>,
        <span class="hljs-string">&quot;tsc.ts&quot;</span>,
        <span class="hljs-string">&quot;diagnosticInformationMap.generated.ts&quot;</span>
    ]
}
</code></pre>
<ul>
<li><p>&#x4F7F;&#x7528;<code>&quot;include&quot;</code>&#x548C;<code>&quot;exclude&quot;</code>&#x5C5E;&#x6027;</p>
<pre><code class="lang-json">{
    <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
        <span class="hljs-string">&quot;module&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>,
        <span class="hljs-string">&quot;noImplicitAny&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;removeComments&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;preserveConstEnums&quot;</span>: <span class="hljs-literal">true</span>,
        <span class="hljs-string">&quot;outFile&quot;</span>: <span class="hljs-string">&quot;../../built/local/tsc.js&quot;</span>,
        <span class="hljs-string">&quot;sourceMap&quot;</span>: <span class="hljs-literal">true</span>
    },
    <span class="hljs-string">&quot;include&quot;</span>: [
        <span class="hljs-string">&quot;src/**/*&quot;</span>
    ],
    <span class="hljs-string">&quot;exclude&quot;</span>: [
        <span class="hljs-string">&quot;node_modules&quot;</span>,
        <span class="hljs-string">&quot;**/*.spec.ts&quot;</span>
    ]
}
</code></pre>
</li>
</ul>
<h2 id="&#x7EC6;&#x8282;">&#x7EC6;&#x8282;</h2>
<p><code>&quot;compilerOptions&quot;</code>&#x53EF;&#x4EE5;&#x88AB;&#x5FFD;&#x7565;&#xFF0C;&#x8FD9;&#x65F6;&#x7F16;&#x8BD1;&#x5668;&#x4F1A;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x503C;&#x3002;&#x5728;&#x8FD9;&#x91CC;&#x67E5;&#x770B;&#x5B8C;&#x6574;&#x7684;<a href="Compiler%20Options.md">&#x7F16;&#x8BD1;&#x5668;&#x9009;&#x9879;</a>&#x5217;&#x8868;&#x3002;</p>
<p><code>&quot;files&quot;</code>&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x76F8;&#x5BF9;&#x6216;&#x7EDD;&#x5BF9;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;&#x7684;&#x5217;&#x8868;&#x3002;
<code>&quot;include&quot;</code>&#x548C;<code>&quot;exclude&quot;</code>&#x5C5E;&#x6027;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;glob&#x5339;&#x914D;&#x6A21;&#x5F0F;&#x5217;&#x8868;&#x3002;
&#x652F;&#x6301;&#x7684;glob&#x901A;&#x914D;&#x7B26;&#x6709;&#xFF1A;</p>
<ul>
<li><code>*</code> &#x5339;&#x914D;0&#x6216;&#x591A;&#x4E2A;&#x5B57;&#x7B26;&#xFF08;&#x4E0D;&#x5305;&#x62EC;&#x76EE;&#x5F55;&#x5206;&#x9694;&#x7B26;&#xFF09;</li>
<li><code>?</code> &#x5339;&#x914D;&#x4E00;&#x4E2A;&#x4EFB;&#x610F;&#x5B57;&#x7B26;&#xFF08;&#x4E0D;&#x5305;&#x62EC;&#x76EE;&#x5F55;&#x5206;&#x9694;&#x7B26;&#xFF09;</li>
<li><code>**/</code> &#x9012;&#x5F52;&#x5339;&#x914D;&#x4EFB;&#x610F;&#x5B50;&#x76EE;&#x5F55;</li>
</ul>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;glob&#x6A21;&#x5F0F;&#x91CC;&#x7684;&#x67D0;&#x90E8;&#x5206;&#x53EA;&#x5305;&#x542B;<code>*</code>&#x6216;<code>.*</code>&#xFF0C;&#x90A3;&#x4E48;&#x4EC5;&#x6709;&#x652F;&#x6301;&#x7684;&#x6587;&#x4EF6;&#x6269;&#x5C55;&#x540D;&#x7C7B;&#x578B;&#x88AB;&#x5305;&#x542B;&#x5728;&#x5185;&#xFF08;&#x6BD4;&#x5982;&#x9ED8;&#x8BA4;<code>.ts</code>&#xFF0C;<code>.tsx</code>&#xFF0C;&#x548C;<code>.d.ts</code>&#xFF0C; &#x5982;&#x679C;<code>allowJs</code>&#x8BBE;&#x7F6E;&#x80FD;<code>true</code>&#x8FD8;&#x5305;&#x542B;<code>.js</code>&#x548C;<code>.jsx</code>&#xFF09;&#x3002;</p>
<p>&#x5982;&#x679C;<code>&quot;files&quot;</code>&#x548C;<code>&quot;include&quot;</code>&#x90FD;&#x6CA1;&#x6709;&#x88AB;&#x6307;&#x5B9A;&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x9ED8;&#x8BA4;&#x5305;&#x542B;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x548C;&#x5B50;&#x76EE;&#x5F55;&#x4E0B;&#x6240;&#x6709;&#x7684;TypeScript&#x6587;&#x4EF6;&#xFF08;<code>.ts</code>, <code>.d.ts</code> &#x548C; <code>.tsx</code>&#xFF09;&#xFF0C;&#x6392;&#x9664;&#x5728;<code>&quot;exclude&quot;</code>&#x91CC;&#x6307;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x3002;JS&#x6587;&#x4EF6;&#xFF08;<code>.js</code>&#x548C;<code>.jsx</code>&#xFF09;&#x4E5F;&#x88AB;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x5982;&#x679C;<code>allowJs</code>&#x88AB;&#x8BBE;&#x7F6E;&#x6210;<code>true</code>&#x3002;
&#x5982;&#x679C;&#x6307;&#x5B9A;&#x4E86;<code>&quot;files&quot;</code>&#x6216;<code>&quot;include&quot;</code>&#xFF0C;&#x7F16;&#x8BD1;&#x5668;&#x4F1A;&#x5C06;&#x5B83;&#x4EEC;&#x7ED3;&#x5408;&#x4E00;&#x5E76;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;
&#x4F7F;&#x7528;<code>&quot;outDir&quot;</code>&#x6307;&#x5B9A;&#x7684;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x6587;&#x4EF6;&#x6C38;&#x8FDC;&#x4F1A;&#x88AB;&#x7F16;&#x8BD1;&#x5668;&#x6392;&#x9664;&#xFF0C;&#x9664;&#x975E;&#x4F60;&#x660E;&#x786E;&#x5730;&#x4F7F;&#x7528;<code>&quot;files&quot;</code>&#x5C06;&#x5176;&#x5305;&#x542B;&#x8FDB;&#x6765;&#xFF08;&#x8FD9;&#x65F6;&#x5C31;&#x7B97;&#x7528;<code>exclude</code>&#x6307;&#x5B9A;&#x4E5F;&#x6CA1;&#x7528;&#xFF09;&#x3002;</p>
<p>&#x4F7F;&#x7528;<code>&quot;include&quot;</code>&#x5F15;&#x5165;&#x7684;&#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<code>&quot;exclude&quot;</code>&#x5C5E;&#x6027;&#x8FC7;&#x6EE4;&#x3002;
&#x7136;&#x800C;&#xFF0C;&#x901A;&#x8FC7;<code>&quot;files&quot;</code>&#x5C5E;&#x6027;&#x660E;&#x786E;&#x6307;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x5374;&#x603B;&#x662F;&#x4F1A;&#x88AB;&#x5305;&#x542B;&#x5728;&#x5185;&#xFF0C;&#x4E0D;&#x7BA1;<code>&quot;exclude&quot;</code>&#x5982;&#x4F55;&#x8BBE;&#x7F6E;&#x3002;
&#x5982;&#x679C;&#x6CA1;&#x6709;&#x7279;&#x6B8A;&#x6307;&#x5B9A;&#xFF0C;<code>&quot;exclude&quot;</code>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#x4F1A;&#x6392;&#x9664;<code>node_modules</code>&#xFF0C;<code>bower_components</code>&#xFF0C;<code>jspm_packages</code>&#x548C;<code>&lt;outDir&gt;</code>&#x76EE;&#x5F55;&#x3002;</p>
<p>&#x4EFB;&#x4F55;&#x88AB;<code>&quot;files&quot;</code>&#x6216;<code>&quot;include&quot;</code>&#x6307;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x6240;&#x5F15;&#x7528;&#x7684;&#x6587;&#x4EF6;&#x4E5F;&#x4F1A;&#x88AB;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;
<code>A.ts</code>&#x5F15;&#x7528;&#x4E86;<code>B.ts</code>&#xFF0C;&#x56E0;&#x6B64;<code>B.ts</code>&#x4E0D;&#x80FD;&#x88AB;&#x6392;&#x9664;&#xFF0C;&#x9664;&#x975E;&#x5F15;&#x7528;&#x5B83;&#x7684;<code>A.ts</code>&#x5728;<code>&quot;exclude&quot;</code>&#x5217;&#x8868;&#x4E2D;&#x3002;</p>
<p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7F16;&#x8BD1;&#x5668;&#x4E0D;&#x4F1A;&#x53BB;&#x5F15;&#x5165;&#x90A3;&#x4E9B;&#x53EF;&#x80FD;&#x505A;&#x4E3A;&#x8F93;&#x51FA;&#x7684;&#x6587;&#x4EF6;&#xFF1B;&#x6BD4;&#x5982;&#xFF0C;&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x5305;&#x542B;&#x4E86;<code>index.ts</code>&#xFF0C;&#x90A3;&#x4E48;<code>index.d.ts</code>&#x548C;<code>index.js</code>&#x4F1A;&#x88AB;&#x6392;&#x9664;&#x5728;&#x5916;&#x3002;
&#x901A;&#x5E38;&#x6765;&#x8BB2;&#xFF0C;&#x4E0D;&#x63A8;&#x8350;&#x53EA;&#x6709;&#x6269;&#x5C55;&#x540D;&#x7684;&#x4E0D;&#x540C;&#x6765;&#x533A;&#x5206;&#x540C;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x6587;&#x4EF6;&#x3002;</p>
<p><code>tsconfig.json</code>&#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x662F;&#x4E2A;&#x7A7A;&#x6587;&#x4EF6;&#xFF0C;&#x90A3;&#x4E48;&#x6240;&#x6709;&#x9ED8;&#x8BA4;&#x7684;&#x6587;&#x4EF6;&#xFF08;&#x5982;&#x4E0A;&#x9762;&#x6240;&#x8FF0;&#xFF09;&#x90FD;&#x4F1A;&#x4EE5;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x9009;&#x9879;&#x7F16;&#x8BD1;&#x3002;</p>
<p>&#x5728;&#x547D;&#x4EE4;&#x884C;&#x4E0A;&#x6307;&#x5B9A;&#x7684;&#x7F16;&#x8BD1;&#x9009;&#x9879;&#x4F1A;&#x8986;&#x76D6;&#x5728;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x76F8;&#x5E94;&#x9009;&#x9879;&#x3002;</p>
<h2 id="types&#xFF0C;typeroots&#x548C;types"><code>@types</code>&#xFF0C;<code>typeRoots</code>&#x548C;<code>types</code></h2>
<p>&#x9ED8;&#x8BA4;&#x6240;&#x6709;<em>&#x53EF;&#x89C1;&#x7684;</em>&quot;<code>@types</code>&quot;&#x5305;&#x4F1A;&#x5728;&#x7F16;&#x8BD1;&#x8FC7;&#x7A0B;&#x4E2D;&#x88AB;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;
<code>node_modules/@types</code>&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x4EE5;&#x53CA;&#x5B83;&#x4EEC;&#x5B50;&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x7684;&#x6240;&#x6709;&#x5305;&#x90FD;&#x662F;<em>&#x53EF;&#x89C1;&#x7684;</em>&#xFF1B;
&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;<code>./node_modules/@types/</code>&#xFF0C;<code>../node_modules/@types/</code>&#x548C;<code>../../node_modules/@types/</code>&#x7B49;&#x7B49;&#x3002;</p>
<p>&#x5982;&#x679C;&#x6307;&#x5B9A;&#x4E86;<code>typeRoots</code>&#xFF0C;<em>&#x53EA;&#x6709;</em><code>typeRoots</code>&#x4E0B;&#x9762;&#x7684;&#x5305;&#x624D;&#x4F1A;&#x88AB;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;
&#x6BD4;&#x5982;&#xFF1A;</p>
<pre><code class="lang-json">{
   <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
       <span class="hljs-string">&quot;typeRoots&quot;</span> : [<span class="hljs-string">&quot;./typings&quot;</span>]
   }
}
</code></pre>
<p>&#x8FD9;&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4F1A;&#x5305;&#x542B;<em>&#x6240;&#x6709;</em><code>./typings</code>&#x4E0B;&#x9762;&#x7684;&#x5305;&#xFF0C;&#x800C;&#x4E0D;&#x5305;&#x542B;<code>./node_modules/@types</code>&#x91CC;&#x9762;&#x7684;&#x5305;&#x3002;</p>
<p>&#x5982;&#x679C;&#x6307;&#x5B9A;&#x4E86;<code>types</code>&#xFF0C;&#x53EA;&#x6709;&#x88AB;&#x5217;&#x51FA;&#x6765;&#x7684;&#x5305;&#x624D;&#x4F1A;&#x88AB;&#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;
&#x6BD4;&#x5982;&#xFF1A;</p>
<pre><code class="lang-json">{
   <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
        <span class="hljs-string">&quot;types&quot;</span> : [<span class="hljs-string">&quot;node&quot;</span>, <span class="hljs-string">&quot;lodash&quot;</span>, <span class="hljs-string">&quot;express&quot;</span>]
   }
}
</code></pre>
<p>&#x8FD9;&#x4E2A;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x5C06;<em>&#x4EC5;&#x4F1A;</em>&#x5305;&#x542B;  <code>./node_modules/@types/node</code>&#xFF0C;<code>./node_modules/@types/lodash</code>&#x548C;<code>./node_modules/@types/express</code>&#x3002;/@types/&#x3002;
<code>node_modules/@types/*</code>&#x91CC;&#x9762;&#x7684;&#x5176;&#x5B83;&#x5305;&#x4E0D;&#x4F1A;&#x88AB;&#x5F15;&#x5165;&#x8FDB;&#x6765;&#x3002;</p>
<p>&#x6307;&#x5B9A;<code>&quot;types&quot;: []</code>&#x6765;&#x7981;&#x7528;&#x81EA;&#x52A8;&#x5F15;&#x5165;<code>@types</code>&#x5305;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x81EA;&#x52A8;&#x5F15;&#x5165;&#x53EA;&#x5728;&#x4F60;&#x4F7F;&#x7528;&#x4E86;&#x5168;&#x5C40;&#x7684;&#x58F0;&#x660E;&#xFF08;&#x76F8;&#x53CD;&#x4E8E;&#x6A21;&#x5757;&#xFF09;&#x65F6;&#x662F;&#x91CD;&#x8981;&#x7684;&#x3002;
&#x5982;&#x679C;&#x4F60;&#x4F7F;&#x7528;<code>import &quot;foo&quot;</code>&#x8BED;&#x53E5;&#xFF0C;TypeScript&#x4ECD;&#x7136;&#x4F1A;&#x67E5;&#x627E;<code>node_modules</code>&#x548C;<code>node_modules/@types</code>&#x6587;&#x4EF6;&#x5939;&#x6765;&#x83B7;&#x53D6;<code>foo</code>&#x5305;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;extends&#x7EE7;&#x627F;&#x914D;&#x7F6E;">&#x4F7F;&#x7528;<code>extends</code>&#x7EE7;&#x627F;&#x914D;&#x7F6E;</h2>
<p><code>tsconfig.json</code>&#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x5229;&#x7528;<code>extends</code>&#x5C5E;&#x6027;&#x4ECE;&#x53E6;&#x4E00;&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CC;&#x7EE7;&#x627F;&#x914D;&#x7F6E;&#x3002;</p>
<p><code>extends</code>&#x662F;<code>tsconfig.json</code>&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x9876;&#x7EA7;&#x5C5E;&#x6027;&#xFF08;&#x4E0E;<code>compilerOptions</code>&#xFF0C;<code>files</code>&#xFF0C;<code>include</code>&#xFF0C;&#x548C;<code>exclude</code>&#x4E00;&#x6837;&#xFF09;&#x3002;
<code>extends</code>&#x7684;&#x503C;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5305;&#x542B;&#x6307;&#x5411;&#x53E6;&#x4E00;&#x4E2A;&#x8981;&#x7EE7;&#x627F;&#x6587;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;&#x3002;</p>
<p>&#x5728;&#x539F;&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x914D;&#x7F6E;&#x5148;&#x88AB;&#x52A0;&#x8F7D;&#xFF0C;&#x7136;&#x540E;&#x88AB;&#x6765;&#x81F3;&#x7EE7;&#x627F;&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x914D;&#x7F6E;&#x91CD;&#x5199;&#x3002;
&#x5982;&#x679C;&#x53D1;&#x73B0;&#x5FAA;&#x73AF;&#x5F15;&#x7528;&#xFF0C;&#x5219;&#x4F1A;&#x62A5;&#x9519;&#x3002;</p>
<p>&#x6765;&#x81F3;&#x6240;&#x7EE7;&#x627F;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;<code>files</code>&#xFF0C;<code>include</code>&#x548C;<code>exclude</code><em>&#x8986;&#x76D6;</em>&#x6E90;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x5C5E;&#x6027;&#x3002;</p>
<p>&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;&#x5728;&#x89E3;&#x6790;&#x65F6;&#x76F8;&#x5BF9;&#x4E8E;&#x5B83;&#x6240;&#x5728;&#x7684;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x6BD4;&#x5982;&#xFF1A;</p>
<p><code>configs/base.json</code>&#xFF1A;</p>
<pre><code class="lang-json">{
  <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
    <span class="hljs-string">&quot;noImplicitAny&quot;</span>: <span class="hljs-literal">true</span>,
    <span class="hljs-string">&quot;strictNullChecks&quot;</span>: <span class="hljs-literal">true</span>
  }
}
</code></pre>
<p><code>tsconfig.json</code>&#xFF1A;</p>
<pre><code class="lang-json">{
  <span class="hljs-string">&quot;extends&quot;</span>: <span class="hljs-string">&quot;./configs/base&quot;</span>,
  <span class="hljs-string">&quot;files&quot;</span>: [
    <span class="hljs-string">&quot;main.ts&quot;</span>,
    <span class="hljs-string">&quot;supplemental.ts&quot;</span>
  ]
}
</code></pre>
<p><code>tsconfig.nostrictnull.json</code>&#xFF1A;</p>
<pre><code class="lang-json">{
  <span class="hljs-string">&quot;extends&quot;</span>: <span class="hljs-string">&quot;./tsconfig&quot;</span>,
  <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
    <span class="hljs-string">&quot;strictNullChecks&quot;</span>: <span class="hljs-literal">false</span>
  }
}
</code></pre>
<h2 id="compileonsave"><code>compileOnSave</code></h2>
<p>&#x5728;&#x6700;&#x9876;&#x5C42;&#x8BBE;&#x7F6E;<code>compileOnSave</code>&#x6807;&#x8BB0;&#xFF0C;&#x53EF;&#x4EE5;&#x8BA9;IDE&#x5728;&#x4FDD;&#x5B58;&#x6587;&#x4EF6;&#x7684;&#x65F6;&#x5019;&#x6839;&#x636E;<code>tsconfig.json</code>&#x91CD;&#x65B0;&#x751F;&#x6210;&#x6587;&#x4EF6;&#x3002;</p>
<pre><code class="lang-json">{
    <span class="hljs-string">&quot;compileOnSave&quot;</span>: <span class="hljs-literal">true</span>,
    <span class="hljs-string">&quot;compilerOptions&quot;</span>: {
        <span class="hljs-string">&quot;noImplicitAny&quot;</span> : <span class="hljs-literal">true</span>
    }
}
</code></pre>
<p>&#x8981;&#x60F3;&#x652F;&#x6301;&#x8FD9;&#x4E2A;&#x7279;&#x6027;&#x9700;&#x8981;Visual Studio 2015&#xFF0C; TypeScript1.8.4&#x4EE5;&#x4E0A;&#x5E76;&#x4E14;&#x5B89;&#x88C5;<a href="https://github.com/TypeStrong/atom-typescript#compile-on-save" target="_blank">atom-typescript</a>&#x63D2;&#x4EF6;&#x3002;</p>
<h2 id="&#x6A21;&#x5F0F;">&#x6A21;&#x5F0F;</h2>
<p>&#x5230;&#x8FD9;&#x91CC;&#x67E5;&#x770B;&#x6A21;&#x5F0F;: <a href="http://json.schemastore.org/tsconfig" target="_blank">http://json.schemastore.org/tsconfig</a>.</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="declaration files/Consumption.html" class="navigation navigation-prev " aria-label="Previous page: 使用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="tsconfig.json.html" class="navigation navigation-next " aria-label="Next page: tsconfig.json">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"工程配置","level":"1.5","depth":1,"next":{"title":"tsconfig.json","level":"1.5.1","depth":2,"path":"doc/handbook/tsconfig.json.md","ref":"./doc/handbook/tsconfig.json.md","articles":[]},"previous":{"title":"使用","level":"1.4.6","depth":2,"path":"doc/handbook/declaration files/Consumption.md","ref":"./doc/handbook/declaration files/Consumption.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"doc/handbook/tsconfig.json.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

